Skip to content

Conversation

@saileshwar-skyflow
Copy link
Collaborator

Why

  • The RevealElement previously did not support updating the token after initialization, users had to force a complete component remount to change it.

Outcome

  • Exposed a setToken method via ref on RevealElement, allowing developers to programmatically update the token and refresh the UI without remounting the component.

@github-actions
Copy link

Gitleaks Findings: No secrets detected. Safe to proceed!

@github-actions
Copy link

Semgrep findings: No issues found, Good to merge.

@github-actions
Copy link

Gitleaks Findings: No secrets detected. Safe to proceed!

@github-actions
Copy link

Semgrep findings: No issues found, Good to merge.

Copy link

Copilot AI left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Pull request overview

This PR adds the ability to update tokens in RevealElement components without remounting by exposing a setToken method via ref. Previously, changing a token required recreating the entire component.

Key changes:

  • Added setToken method to RevealSkyflowElement class for updating internal token state
  • Modified RevealContainer.reveal() to fetch fresh tokens from elements before API calls
  • Exposed setToken via useImperativeHandle in the RevealElement component using forwardRef

Reviewed changes

Copilot reviewed 8 out of 8 changed files in this pull request and generated 2 comments.

Show a summary per file
File Description
src/utils/skyflow-error-code/index.ts Added ELEMENT_NOT_FOUND error code for when element is not found in container
src/utils/logs/index.ts Added error message template for ELEMENT_NOT_FOUND
src/core/RevealSkyflowElement/index.ts Added setToken method to update internal token state
src/core/RevealContainer/index.ts Modified reveal() to fetch fresh tokens from element instances before API call
src/components/RevealElement/index.tsx Converted to forwardRef and exposed setToken via useImperativeHandle
tests/core/RevealContainer.test.js Added test verifying reveal() uses updated token after setToken call
tests/components/components.test.js Added tests for RevealElement rendering and setToken functionality via ref
tests/components/snapshots/components.test.js.snap Added snapshot for RevealElement component rendering test

💡 Add Copilot custom instructions for smarter, more guided reviews. Learn how to get started.

@github-actions
Copy link

Gitleaks Findings: No secrets detected. Safe to proceed!

@github-actions
Copy link

Semgrep findings: No issues found, Good to merge.

@saileshwar-skyflow saileshwar-skyflow changed the base branch from main to release/25.12.0 December 19, 2025 09:21
@saileshwar-skyflow saileshwar-skyflow merged commit 7036b45 into release/25.12.0 Dec 19, 2025
4 checks passed
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

4 participants